# -*- coding: utf-8 -*-

greek_ch = [u'', u'α', u'β', u'γ', u'δ', u'ε', u'ζ', u'η', u'θ', 
            u'ι', u'κ', u'λ', u'μ', u'ν', u'ξ', u'ο', u'π', u'ρ', 
            u'σ', u'τ', u'υ', u'φ', u'χ', u'ψ', u'ω', 
            u'ά', u'έ', u'ί', u'ό', u'ύ', u'ή', u'ώ', u'ς', u'ϊ', u'ΰ', u'ϋ', u'ΐ' ]

#map from accented characters to simple characters
simple_ch = {  0x03AC:0x03B1, 0x03AD:0x03B5, 0x03AF:0x03B9,0x03CC:0x03BF ,0x03CD:0x03C5,0x03AE:0x03B7,0x03CE:0x03C9,0x03CA:0x03B9,0x03CB:0x03C5 , 0x03B0:0x03C5, 0x0390:0x03B9}
greek_ch_cons = [u'β', u'γ', u'δ',u'ζ',u'θ',u'κ', u'λ', u'μ', u'ν', u'ξ',u'π', u'ρ',u'σ', u'τ',u'φ', u'χ', u'ψ',u'ς',]
greek_ch_vowels = [u'α',u'ε',u'η',u'ι',u'ο',u'υ',u'ω',u'ά', u'έ', u'ί', u'ό', u'ύ', u'ή', u'ώ',u'ϊ', u'ΰ', u'ϋ', u'ΐ']

greeklish_ch_vowels = ['a','e','i','o','u','w','y','h',]
greeklish_ch_cons = ['b','c','d','f','g','j','k','l','m','n','p','q','r','s','t','v','x','z','1','2','3','4','5','6','7','8','9','0',]

greeklish_ch = ['','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
                'p','q','r','s','t','u','v','w','x','y','z',
                '1','2','3','4','5','6','7','8','9','0', ]

orthographic_grkl = ['a', 'v','b','g', 'd', 'e', 'z', 'h', '8', 'th','i', 'k','l','m','n','3','o','p','r','s','t','y','u','f','x','ps','w', 'ai', 'ei','oi','mp', 'ou', 'oy']
orthographic_grkl_vowels = ['a','e','h','i','o','y','w','u']
orthographic_grkl_cons = [i for i in orthographic_grkl if i not in orthographic_grkl_vowels]
phonetic_grkl = ['a','b','v','g','d','e','z','i','th','i','k','l','m','n','ks','p','r','s','t','u','f','x','ps','o']
phonetic_grkl_vowels= ['a','e','i','o','u']
phonetic_grkl_cons = [i for i in phonetic_grkl if i not in phonetic_grkl_vowels]

# these are moved into the char_inputs
dipthongs = {'ps':u'ψ','ph':u'φ',
             'th':u'θ',
             'ks':u'ξ','ai':u'ε','ei':u'ι','ei':u'η',
             'bb':u'β','gg':u'γ','kk':u'κ','ll':u'λ','mm':u'μ','nn':u'ν', 'rr':u'ρ','ss':u'σ','tt':u'τ','ch':u'χ'}#,'oy':u'ου', 'ou':u'ου'}
dipthongs_split=['th','ps','ks', '8','j','3']
gr_split=[u'θ',u'ψ',u'ξ',u'τη']
dipthongs_normal = {'bb':u'ββ','gg':u'γγ','kk':u'κκ','ll':u'λλ','mm':u'μμ','nn':u'νν', 'rr':u'ρρ','ss':u'σσ','tt':u'ττ','ph':u'πη','th':u'τη'}
dipthongs_rev = {u'αι':'e', u'μπ':'b',   u'ββ':'b',u'γγ':'g',u'κκ':'k',u'λλ':'l',u'μμ':'m',u'νν':'n', u'ρρ':'r',u'σσ':'s',u'ττ':'t',
                 u'ει':'i', u'οι':'i', u'αυ':'af', u'ευ':'ef', u'ου':'u', u'γκ':'g',u'ντ':'d'}
dipthongs_rev_normal = {u'ββ':'bb',u'γγ':'gg',u'κκ':'kk',u'λλ':'ll',u'μμ':'mm',u'νν':'nn', u'ρρ':'rr',u'σσ':'ss',u'ττ':'tt', u'γκ':'gk', }
########################### left here only for legacy purposes
greek_special = [u'ψ', u'φ', u'θ', u'ξ',u'χ',]
greeklish_special = ['f', '8', '3', 'x']


assert(len(greeklish_ch)==37)
assert(len(greeklish_ch_vowels)+len(greeklish_ch_cons)==len(greeklish_ch)-1)
assert(len(greek_ch_vowels)+len(greek_ch_cons)==len(greek_ch)-1)

greek_bigrams = []
for c1 in greek_ch:
    for c2 in greek_ch:
        cc = c1+c2
        greek_bigrams.append( cc)

#print greek_bigrams

assert(len(greek_bigrams)==(len(greek_ch))*(len(greek_ch)))

greeklish_bigrams = []
for c1 in greeklish_ch:
    for c2 in greeklish_ch:
        cc = c1+c2
        greeklish_bigrams.append(cc)
        
assert(len(greeklish_bigrams)==len(greeklish_ch)*len(greeklish_ch))

greek_dipthongs    = [ u'αι',u'αί',u'άι',u'αϊ',
                       u'ει',u'εί',u'έι',u'εϊ',
                       u'οι',u'οί',u'όι',u'οϊ',
                       u'αυ',u'αύ',u'άυ',u'αϋ',
                       u'ευ',u'εύ',u'έυ',u'εϋ',
                       u'ου',u'όυ',u'ού',u'οϋ',
                       u'γγ',u'γκ',u'γξ',u'γχ',
                       u'μπ',u'ντ',]
phonemes_dipthongs = [ '[e]','[e]','[a][i]','[a][i]',
                       '[i]','[i]','[e][i]','[e][i]',
                       '[i]','[i]','[o][i]','[o][i]',
                       '[a][f]/[a][v]','[a][f]/[a][v]','[a][i]','[a][i]'
                       ,'[e][f]/[e][v]','[e][f]/[e][v]','[e][i]','[e][i]',
                       '[u]','[o][i]','[u]','[o][i]',
                       '[g]','[g]','[nks]','[nx]',
                       '[b]','[nt]',]
phonemes_ch = ['', '[a]', '[v]', '[gh]', '[d]', '[e]','[z]','[i]','[th]','[i]','[k]','[l]','[m]','[n]','[ks]','[o]','[p]','[r]','[s]','[t]','[i]','[f]','[x]','[ps]','[o]','[a]','[e]','[i]','[o]','[i]','[i]','[o]','[s]','[i]','[i]','[i]','[i]',]



assert(len(greek_ch)==len(phonemes_ch))



#for i in range(0,len(greek_ch)):
#    print ('%s  = %s' % (greek_ch[i], phonemes_ch[i]))

assert(len(greek_dipthongs)==len(phonemes_dipthongs))

#for i in range(0,len(greek_dipthongs)):
#    print ('%s  = %s' % (greek_dipthongs[i], phonemes_dipthongs[i]))

if __name__ == '__main__':
    print greek_ch[1].encode('utf-8')
    print len(greek_ch[1])
    print len(greek_dipthongs[1])#.encode('utf-8')